home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / toolkit / riruf1 / sendmail.frm < prev   
Text File  |  1995-05-19  |  4KB  |  141 lines

  1. VERSION 2.00
  2. Begin Form SendMail 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Send Mail"
  6.    ClientHeight    =   1695
  7.    ClientLeft      =   1890
  8.    ClientTop       =   2145
  9.    ClientWidth     =   5835
  10.    Height          =   2100
  11.    KeyPreview      =   -1  'True
  12.    Left            =   1830
  13.    LinkTopic       =   "Form2"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   1695
  17.    ScaleWidth      =   5835
  18.    Top             =   1800
  19.    Width           =   5955
  20.    Begin TextBox txtMsg 
  21.       Height          =   285
  22.       Left            =   1200
  23.       TabIndex        =   2
  24.       Top             =   840
  25.       Width           =   4575
  26.    End
  27.    Begin TextBox txtSubject 
  28.       Height          =   285
  29.       Left            =   1200
  30.       TabIndex        =   1
  31.       Top             =   480
  32.       Width           =   4575
  33.    End
  34.    Begin TextBox txtAddress 
  35.       Height          =   285
  36.       Left            =   1200
  37.       TabIndex        =   0
  38.       Top             =   120
  39.       Width           =   2775
  40.    End
  41.    Begin CommandButton cmdSend 
  42.       Caption         =   "&Send"
  43.       Default         =   -1  'True
  44.       Height          =   375
  45.       Left            =   1680
  46.       TabIndex        =   4
  47.       Top             =   1200
  48.       Width           =   975
  49.    End
  50.    Begin MapiMessages MapiMessages 
  51.       AddressCaption  =   ""
  52.       AddressEditFieldCount=   0
  53.       AddressLabel    =   ""
  54.       AddressModifiable=   0   'False
  55.       AddressResolveUI=   0   'False
  56.       FetchMsgType    =   ""
  57.       FetchSorted     =   0   'False
  58.       FetchUnreadOnly =   0   'False
  59.       Left            =   600
  60.       Top             =   1200
  61.    End
  62.    Begin MapiSession MapiSession 
  63.       Action          =   0  'Nothing
  64.       DownloadMail    =   -1  'True
  65.       Left            =   120
  66.       LogonUI         =   -1  'True
  67.       NewSession      =   0   'False
  68.       Password        =   ""
  69.       Top             =   1200
  70.       UserName        =   ""
  71.    End
  72.    Begin CommandButton cmdClose 
  73.       BackColor       =   &H00C0C0C0&
  74.       Cancel          =   -1  'True
  75.       Caption         =   "&Close"
  76.       Height          =   375
  77.       Left            =   3360
  78.       TabIndex        =   3
  79.       Top             =   1200
  80.       Width           =   975
  81.    End
  82.    Begin Label Label3 
  83.       BackColor       =   &H00C0C0C0&
  84.       Caption         =   "Message:"
  85.       Height          =   255
  86.       Left            =   120
  87.       TabIndex        =   7
  88.       Top             =   840
  89.       Width           =   975
  90.    End
  91.    Begin Label Label2 
  92.       BackColor       =   &H00C0C0C0&
  93.       Caption         =   "Subject:"
  94.       Height          =   255
  95.       Left            =   120
  96.       TabIndex        =   6
  97.       Top             =   480
  98.       Width           =   855
  99.    End
  100.    Begin Label Label1 
  101.       BackColor       =   &H00C0C0C0&
  102.       Caption         =   "Address:"
  103.       Height          =   255
  104.       Left            =   120
  105.       TabIndex        =   5
  106.       Top             =   120
  107.       Width           =   855
  108.    End
  109. End
  110. Option Explicit
  111.  
  112. Sub cmdClose_Click ()
  113.     Unload sendmail
  114. End Sub
  115.  
  116. Sub cmdSend_Click ()
  117.     Dim sSubject$, sAddress$, sMsg$
  118.  
  119.     sSubject = RTrim$(txtSubject.Text)
  120.     sAddress = RTrim$(txtAddress.Text)
  121.     sMsg = RTrim$(txtMsg.Text)
  122.  
  123.     If Len(sAddress) < 1 Then
  124.         StopUser "The address field is blank!"
  125.         Exit Sub
  126.     End If
  127.  
  128.     SendSingleMailMsg sendmail, sSubject, sMsg, sAddress
  129.     DoEvents
  130.     txtSubject.Text = ""
  131.     txtAddress.Text = ""
  132.     txtMsg.Text = ""
  133. End Sub
  134.  
  135. Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)
  136.     If KeyCode = KEY_F1 Then
  137.         CallHelp Send_Mail_Form
  138.     End If
  139. End Sub
  140.  
  141.